package net.sky.oa.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * 相册分类表
 * TalAlbum. @author hond
 */
@Entity
@Table(name = "TAL_ALBUM")//相册分类表
public class TalAlbum implements java.io.Serializable {

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields

	protected Long id;
	private String name;     //相册分类名称：公司相册、员工相册
	private Integer type;       //类型
	private Integer ispublic;//是否公开：1是2否
	private String picurl;   //封面相片路径
	private Date createtime; //创建时间
	private Date lasttime;   //最后修改时间
	private String desn;     //描述
	private Integer status;     //状态
	private SysEmployee user;  //创建人

	// Constructors

	/** default constructor */
	public TalAlbum() {
	}
	
	public TalAlbum(Long id,String name,String picurl,String desn){
		this.id=id;
		this.name=name;
		this.picurl=picurl;
		this.desn=desn;
	}
	public TalAlbum(Long id,String name,String picurl,String desn,SysEmployee user){
		this.id=id;
		this.name=name;
		this.picurl=picurl;
		this.desn=desn;
		this.user=user;
	}
	@Id
    @Column(name = "ID", unique = true, nullable = false)
	@SequenceGenerator(name="SQ_TALALBUM_ID",sequenceName="SQ_TALALBUM_ID",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_TALALBUM_ID")
	public Long getId() {
        return id;
    }

    public void setId(Long id){
    	this.id = id;
    }

	/** minimal constructor */
	public TalAlbum(Long id) {
		this.id = id;
	}
	
	@Column(name = "NAME", length = 40)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "TYPE", precision = 2, scale = 0)
	public Integer getType() {
		return this.type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "ISPUBLIC", precision = 1, scale = 0)
	public Integer getIspublic() {
		return this.ispublic;
	}

	public void setIspublic(Integer ispublic) {
		this.ispublic = ispublic;
	}

	@Column(name = "PICURL", length = 100)
	public String getPicurl() {
		return this.picurl;
	}

	public void setPicurl(String picurl) {
		this.picurl = picurl;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATETIME")
	public Date getCreatetime() {
		return this.createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "LASTTIME", length = 7)
	public Date getLasttime() {
		return this.lasttime;
	}

	public void setLasttime(Date lasttime) {
		this.lasttime = lasttime;
	}

	@Column(name = "DESN", length = 100)
	public String getDesn() {
		return this.desn;
	}

	public void setDesn(String desn) {
		this.desn = desn;
	}

	@Column(name = "STATUS", precision = 2, scale = 0)
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "USER_ID")
	public SysEmployee getUser() {
		return this.user;
	}

	public void setUser(SysEmployee user) {
		this.user = user;
	}

}